// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning;

public sealed partial class OverallBucket
{
	/// <summary>
	/// <para>
	/// The length of the bucket in seconds. Matches the job with the longest bucket_span value.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("bucket_span")]
	public long BucketSpan { get; init; }

	/// <summary>
	/// <para>
	/// If true, this is an interim result. In other words, the results are calculated based on partial input data.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("is_interim")]
	public bool IsInterim { get; init; }

	/// <summary>
	/// <para>
	/// An array of objects that contain the max_anomaly_score per job_id.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("jobs")]
	public IReadOnlyCollection<Elastic.Clients.Elasticsearch.Serverless.MachineLearning.OverallBucketJob> Jobs { get; init; }

	/// <summary>
	/// <para>
	/// The top_n average of the maximum bucket anomaly_score per job.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("overall_score")]
	public double OverallScore { get; init; }

	/// <summary>
	/// <para>
	/// Internal. This is always set to overall_bucket.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("result_type")]
	public string ResultType { get; init; }

	/// <summary>
	/// <para>
	/// The start time of the bucket for which these results were calculated.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("timestamp")]
	public long Timestamp { get; init; }

	/// <summary>
	/// <para>
	/// The start time of the bucket for which these results were calculated.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("timestamp_string")]
	public DateTimeOffset TimestampString { get; init; }
}